#
#  Be sure to run `pod spec lint ffmpeg-desktop.podspec' to ensure this is a
#  valid spec and to remove all comments including this before submitting the spec.
#
#  To learn more about Podspec attributes see https://guides.cocoapods.org/syntax/podspec.html
#  To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/
#

Pod::Spec.new do |spec|

    # ―――  Spec Metadata  ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
    #
    #  These will help people to find your library, and whilst it
    #  can feel like a chore to fill in it's definitely to your advantage. The
    #  summary should be tweet-length, and the description more in depth.
    #
  
    spec.name         = "COMPONENT_NAME"
    spec.version      = "COMPONENT_VERSION"
    spec.summary      = "A complete, cross-platform solution to record, convert and stream audio and video."
  
    spec.description  = <<-DESC
    FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations.
                     DESC

  
    spec.license      = "LGPL"
  
    spec.author       = "COMPONENT_AUTHOR"
  
    # desktop only
    spec.platform     = :osx, "10.13"
  
  
    # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
    #
    #  Specify the location from where the source should be retrieved.
    #  Supports git, hg, bzr, svn and HTTP.
    #
  
    spec.source = { :http => "COMPONENT_LOAD_URL" }
  
  
    # ――― Source Code and Libraries ―――――――――――――――――――――――――――――――――――――――――――――――― #
    #
  
    spec.subspec "libavcodec" do |sp|
      sp.source_files          = "include/libavcodec/**/*.h"
      sp.header_mappings_dir   = "include"
      sp.vendored_libraries    = [
        "lib/libavcodec.dylib",
        "lib/libdav1d.dylib",
        "lib/libfdk-aac.dylib",
        "lib/libx264.dylib",
      ]
    end
  
    spec.subspec "libavdevice" do |sp|
      sp.source_files          = 'include/libavdevice/*.h'
      sp.header_mappings_dir   = "include"
      sp.vendored_libraries    = ["lib/libavdevice.dylib","lib/libavdevice.dylib.dSYM"]
    end
  
    spec.subspec "libavfilter" do |sp|
      sp.source_files          = 'include/libavfilter/*.h'
      sp.header_mappings_dir   = "include"
      sp.vendored_libraries    = ["lib/libavfilter.dylib","lib/libavfilter.dylib.dSYM"]
     
    end
  
    spec.subspec "libavformat" do |sp|
      sp.source_files          = 'include/libavformat/*.h'
      sp.header_mappings_dir   = "include"
      sp.vendored_libraries    = ["lib/libavformat.dylib","lib/libavformat.dylib.dSYM"] 
    end
  
    spec.subspec "libavutil" do |sp|
      sp.source_files          = 'include/libavutil/**/*.h'
      sp.header_mappings_dir   = "include"
      sp.vendored_libraries    = ["lib/libavutil.dylib", "lib/libavutil.dylib.dSYM"]
    end
  
    spec.subspec "libpostproc" do |sp|
      sp.source_files          = 'include/libpostproc/*.h'
      sp.header_mappings_dir   = "include"
      sp.vendored_libraries    = ["lib/libpostproc.dylib", "lib/libpostproc.dylib.dSYM"]
    end
  
    spec.subspec "libswresample" do |sp|
      sp.source_files          = 'include/libswresample/*.h'
      sp.header_mappings_dir   = "include"
      sp.vendored_libraries    = ["lib/libswresample.dylib", "lib/libswresample.dylib.dSYM"]
    end
  
    spec.subspec "libswscale" do |sp|
      sp.source_files          = 'include/libswscale/*.h'
      sp.header_mappings_dir   = "include"
      sp.vendored_libraries    = ["lib/libswscale.dylib", "lib/libswscale.dylib.dSYM"]
    end

    spec.subspec "libvecryptor" do |sp|
      sp.source_files          = 'include/libvecryptor/*.h'
      sp.header_mappings_dir   = "include"
      sp.vendored_libraries    = ["lib/libvecryptor.dylib", "lib/libvecryptor.dylib.dSYM"]
    end
  
    spec.subspec "libffmpeg" do |sp|
      sp.source_files          = 'include/libffmpeg/*.h'
      sp.header_mappings_dir   = "include"
      sp.vendored_libraries    = ["lib/libffmpeg.dylib","lib/libffmpeg.dylib.dSYM"]
    end
  
    spec.subspec "internal_headers" do |sp|
      sp.source_files        = "include/internal/**/*.h"
      sp.header_mappings_dir = "include/internal/"
    end
  
    spec.subspec "program" do |sp|
      sp.resource = "bin/ffmpeg"
    end
  
    # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
    #
    #  Link your library with frameworks, or libraries. Libraries do not include
    #  the lib prefix of their name.
    #
  
    spec.static_framework = true
  
    spec.libraries = "iconv", "bz2", "z"
  
    spec.frameworks = "VideoToolbox", "AudioToolbox", "AVFoundation", "CoreImage", "Security"
  
  end
  
